package cn.yunhe.daoImpl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import cn.yunhe.dao.BookDao;
import cn.yunhe.factory.SqlSessionFactoryUtil;
import cn.yunhe.model.Book;

public class BookDaoImpl implements BookDao {

	public List<Book> searchBook(Book book) {
		SqlSession sqlSession = null;
		List<Book> listBook = null;
		try {
			sqlSession = SqlSessionFactoryUtil.getSqlSession();
			listBook = sqlSession.selectList("bookMapper.searchBook",book);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (sqlSession != null) {
				sqlSession.close();
			}
		}
		return listBook;
	}

}
